import request from '@/utils/request'
// const root = "https://test.yueyangshuyuan.com";
// const root = "https://yueyangshuyuan.com";
let root="https://test.yueyangshuyuan.com";
let url=window.location.href;
if(url.indexOf("test.yueyangshuyuan.com")!=-1){ //生产
  root="https://test.yueyangshuyuan.com";
}else if(url.indexOf("yueyangshuyuan.com")!=-1){
  root = "https://yueyangshuyuan.com";
}else {
  root="https://test.yueyangshuyuan.com";
}
export function login(data) {
  return request({
    url: root+'/sojourn/user/login?username=' + data.username + '&password=' + data.password,
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: root+'/sojourn/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: root+'/sojourn/user/logout',
    method: 'post'
  })
}
